using LiJ.Common.Core.Enums;
using System.Collections.Generic;

namespace LiJ.Common.Core
{
	/// <summary>
	///  分页实体
	/// </summary>
	public class PageListMo<TModel> : ResultMo where TModel : class, new()
	{
		/// <summary>
		/// 实体列表
		/// </summary>
		public List<TModel> Data
		{
			get;
			set;
		}

		/// <summary>
		/// 总数
		/// </summary>
		public long Total
		{
			get;
			set;
		}

		/// <summary>
		///    空构造函数  照顾  json序列化 
		/// </summary>
		public PageListMo()
		{
		}

		/// <summary>
		///   出错时  构造函数    
		/// </summary>
		/// <param name="ret"></param>
		/// <param name="message"></param>
		public PageListMo(ResultTypes ret, string message = "")
			: base(ret, message)
		{
		}

		/// <summary>
		///   正常赋值时的实体
		/// </summary>
		/// <param name="list"></param>
		/// <param name="totalCount"></param>
		public PageListMo(long totalCount, List<TModel> list)
		{
            Data = list;
            Total = totalCount;
		}
	}
}
